/* frame_pic.h */

#ifndef DODO_FRAME_PIC_H
#define DODO_FRAME_PIC_H

#include <dodo_plot/kernel/plotfwd.h>
#include <dodo_plot/kernel/basic_elements.h>
#include <dodo_plot/kernel/p_node.h>
#include <dodo_plot/kernel/picture.h>
#include <dodo_plot/kernel/canvas.h>

namespace dodo_plot
{

class Frame_Pic : public P_Node
{
	friend Picture frame(const Picture& picture, double w, double h, bool crop);

	Frame_Pic(const Picture& picture, double w, double h, bool crop)
			: content_(picture), 
			w_(w), h_(h),
			crop_(crop)
	{ }

	double height() const { return h_; }
	double width() const { return w_; }
	Position local_pos() const { return Position(0.0, w_, 0.0, h_);}
	void draw(const Plotter& plotter) const;

	Picture content_;
	double w_, h_;
	bool crop_;
};

}

#endif //DODO_FRAME_PIC_H

